<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
    <div class="col-sm-12 select-info">
        <form id="job-form">
            <div class="col-md-3">
                <label class="form-inline control-label" th:text="${id}">
                </label>
            </div>
            <div class="select-list">
                <ul>
                    <li>
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="reset()"><i class="fa fa-search"></i>&nbsp;重置</a>
                    </li>
                    <li>
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="searchSn()"><i class="fa fa-search"></i>&nbsp;查询</a>
                    </li>
                </ul>
            </div>
        </form>
        <div class="wrapper wrapper-content animated fadeInRight ibox-content">
            <form class="form-horizontal m" id="form-errorcode-add">
                <div class="form-group">
                    <label class="col-sm-3 control-label">js:</label>
                    <div class="col-sm-8">
                        <textarea class="form-control" rows="20" name="hwjs" id="hwjs"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="form-control-static col-sm-offset-9">
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="test()"><i class="fa fa-search"></i>&nbsp;调试</a>
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="test2()"><i class="fa fa-search"></i>&nbsp;test2</a>
                    </div>
                </div>
            </form>
        </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "module/elenium"
        
        function reset() {
            $.ajax({
                async:false,
                type : 'post',
                url: prefix + "/reset" ,
                success : function(result) {
                    console.log("result=",result);
                    if (!result) {
                    }
                }
            });
        }

        function searchSn() {
            $.ajax({
                async:false,
                type : 'post',
                url: prefix + "/search" ,
                success : function(result) {
                    console.log("result=",result);
                    if (!result) {
                    }
                }
            });
        }

        function test(){
            var fromId="#form-errorcode-add";
            $.modal.loading("正在处理中，请稍后...");
            var config = {
                url: prefix + "/test",
                type: "post",
                dataType: "json",
                data: $(fromId).serialize(),
                success: function(result) {
                    console.log(result);
                    $.modal.closeLoading();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    console.log(XMLHttpRequest.status);
                    console.log(XMLHttpRequest.readyState);
                    console.log(textStatus);
                    $.modal.closeLoading();
                }
            };
            $.ajax(config);

        }

        function test2(){
            var config = {
                url: prefix + "/test2",
                type: "post",
                dataType: "json",
                success: function(result) {
                    console.log(result);
                }
            };
            $.ajax(config);

        }
    </script>
</body>
</html>